#ifndef REIMAGE_H
#define REIMAGE_H
#include<QString>
#include<QColor>
#include<QImage>

class Reimage
{
public:
    enum Type {Type_Fill=1, Type_Scaled, Type_Fit_Width, Type_Fit_Height, Type_Null};
    
    Reimage();
    Reimage(const QString &, int, int);
    Reimage(const QString &, const QString &, int, int);
    ~Reimage();
    
    bool load(const QString &);
    bool status();
    
    void set_filename_save(const QString &);
    void set_width(int width);
    void set_height(int height);
    
    void fill(QColor color = QColor(255, 255, 255));
    void scaled();
    void fit_width();
    void fit_height();
    
    void run(Reimage::Type);
    bool save(int quality=80);

private:
    void scaled(int, int);
    
    QImage  image;
    QString filename_save;
    bool    image_status;
    int     width_save, height_save;
};

#endif // REIMAGE_H
